const path = require('path')
const htmlwebpackplugin = require('html-webpack-plugin')
const htmlplugin = new htmlwebpackplugin({
    template: './src/002.index.html',
    filename: 'index.html'
})
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
    mode: 'development', // 开发模式 ，项目上线时，使用 production
    entry: path.join(__dirname, '/src/index.js'), // 配置需要编译的文件的路径
    output: {
        filename: 'bundle.js',
        path: path.join(__dirname, '/dist')
    },
    plugins: [htmlplugin, new VueLoaderPlugin()],
    module: {
        rules: [
            {
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },
            {
                test: /\.less$/,
                use: ['style-loader', 'css-loader', 'less-loader']
            },
            {
                test: /\.scss$/,
                use: ['style-loader', 'css-loader', 'sass-loader']
            },
            { test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader'] },
            {
                test: /\.jpg|png|gif|bmp|ttf|eot|svg|woff|woff2$/,
                use: 'url-loader?limit=16933'
            },
            { test: /\.vue$/, loader: 'vue-loader' }
        ]
    }
}